<?php
require_once(__PHY_LIB.'/func/db.func.php');

function smarty_function_sms_count($rP, &$smarty)
{
	$rP['user_id'] = max(0, (int)$rP['user_id']);
	$sQ = "SELECT COUNT(sms_id) FROM app_sms WHERE reciever='{$rP['user_id']}' AND status='UNREAD'";
	return (int)db_one($sQ);
}
?>
